package com.speedricemanager.other.utils;

import android.content.Context;
import android.util.DisplayMetrics;
import android.util.TypedValue;


public class DpNumber {
    public static int dip2px(Context context, float dipValue) {

        final float scale = context.getResources().getDisplayMetrics().density;

        return (int) (dipValue * scale + 0.5f);
    }


    private int dipToPx(Context context,int dip) {
        final DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
        return (int) (displayMetrics.density * dip + 0.5f);
    }



    public static int dp2px(Context context, float dpValue) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }


}
